package easy;

/**
 * LCP 61. 气温变化趋势
 * 创建时间：2024-06-21 09:17
 */
public class LCP气温变化趋势_61 {
    public int temperatureTrend(int[] temperatureA, int[] temperatureB) {
        int ans = 0, cur = 0;
        for (int i = 1; i < temperatureA.length; i++) {
            if (Integer.compare(temperatureA[i], temperatureA[i-1]) == Integer.compare(temperatureB[i], temperatureB[i-1]))
                ans = Math.max(ans, ++cur);
            else
                cur = 0;
        }
        return ans;
    }
}
